<!DOCTYPE html>
<html>
<head>
    <title>Nuclear Cross Section Plot for 142Nd</title>
</head>
<body>
<canvas id="physics-plot" width="550" height="420" style="border:1px solid #ccc;"></canvas>
<script>
    const canvas = document.getElementById('physics-plot');
    const ctx = canvas.getContext('2d');

    // Style
    ctx.fillStyle = 'black';
    ctx.strokeStyle = 'black';
    ctx.lineWidth = 1;
    ctx.font = '16px sans-serif';

    // Chart dimensions
    const margin = { top: 50, right: 20, bottom: 60, left: 50 };
    const chartWidth = canvas.width - margin.left - margin.right;
    const chartHeight = canvas.height - margin.top - margin.bottom;

    // Data scale
    const xMin = 0, xMax = 22;
    const yMin = 0, yMax = 40;

    // Mapping functions from data coordinates to canvas coordinates
    const mapX = (val) => margin.left + (val - xMin) / (xMax - xMin) * chartWidth;
    const mapY = (val) => margin.top + chartHeight - (val - yMin) / (yMax - yMin) * chartHeight;

    // Draw axes
    ctx.beginPath();
    ctx.moveTo(mapX(xMin), mapY(yMin));
    ctx.lineTo(mapX(xMax), mapY(yMin)); // X-axis
    ctx.moveTo(mapX(xMin), mapY(yMin));
    ctx.lineTo(mapX(xMin), mapY(yMax)); // Y-axis
    ctx.stroke();

    // Draw Y-axis ticks and labels
    ctx.textAlign = 'right';
    ctx.textBaseline = 'middle';
    const yTicks = [10, 20, 30, 40];
    yTicks.forEach(tick => {
        const y = mapY(tick);
        ctx.beginPath();
        ctx.moveTo(mapX(xMin), y);
        ctx.lineTo(mapX(xMin) - 5, y);
        ctx.stroke();
        ctx.fillText(tick, mapX(xMin) - 8, y);
    });

    // Draw X-axis ticks and labels
    ctx.textAlign = 'center';
    ctx.textBaseline = 'top';
    const xTicks = [0, 8, 10, 12, 14, 16, 18, 20, 22];
    xTicks.forEach(tick => {
        const x = mapX(tick);
        ctx.beginPath();
        ctx.moveTo(x, mapY(yMin));
        ctx.lineTo(x, mapY(yMin) + 5);
        ctx.stroke();
        ctx.fillText(tick, x, mapY(yMin) + 8);
    });

    // Draw X-axis minor ticks
    for (let i = 9; i <= 21; i += 2) {
        const x = mapX(i);
        ctx.beginPath();
        ctx.moveTo(x, mapY(yMin));
        ctx.lineTo(x, mapY(yMin) + 3);
        ctx.stroke();
    }

    // Draw axis titles
    ctx.textAlign = 'left';
    ctx.textBaseline = 'bottom';
    ctx.font = '17px sans-serif';
    ctx.fillText('\u03c3(fm\u00b2)', mapX(0), margin.top - 15); // σ(fm²)

    ctx.textAlign = 'center';
    ctx.textBaseline = 'bottom';
    ctx.fillText('E\u03b3(MeV)', canvas.width / 2, canvas.height - 25);

    // Data points for the curve, digitized from the original image
    const dataPoints = [
        { x: 9.1, y: 0 }, { x: 9.5, y: 2 }, { x: 10.0, y: 8 },
        { x: 10.5, y: 10.5 }, { x: 11.0, y: 9.5 }, { x: 11.5, y: 12 },
        { x: 12.0, y: 17 }, { x: 12.5, y: 22 }, { x: 13.0, y: 28 },
        { x: 13.5, y: 33 }, { x: 14.0, y: 36.5 }, { x: 14.5, y: 38 },
        { x: 15.0, y: 37 }, { x: 15.5, y: 34 }, { x: 16.0, y: 30 },
        { x: 16.5, y: 25 }, { x: 17.0, y: 21 }, { x: 17.5, y: 17 },
        { x: 18.0, y: 14 }, { x: 18.5, y: 11.5 }, { x: 19.0, y: 9.5 },
        { x: 19.5, y: 7.5 }, { x: 20.0, y: 6 }, { x: 20.2, y: 5.5 }
    ];

    // Draw the curve
    ctx.beginPath();
    ctx.lineWidth = 1.8;
    ctx.moveTo(mapX(dataPoints[0].x), mapY(dataPoints[0].y));
    dataPoints.slice(1).forEach(p => ctx.lineTo(mapX(p.x), mapY(p.y)));
    ctx.stroke();

    // Add text inside the plot
    ctx.lineWidth = 1;
    ctx.font = '18px sans-serif';
    ctx.textAlign = 'left';
    ctx.textBaseline = 'alphabetic';
    ctx.fillText('142 Nd', mapX(17.5), mapY(32));

    // Add Figure caption
    ctx.font = '18px serif';
    ctx.textAlign = 'center';
    ctx.textBaseline = 'bottom';
    ctx.fillText('Fig. 2.32', canvas.width / 2, canvas.height - 2);

</script>
</body>
</html>